﻿// <copyright file="SkipListCollection.cs" company="TenneySoftware">
// Copyright (c) 2009 All Right Reserved
// </copyright>
// <author>Robert Tenney</author>
// <email>rob10e@yahoo.com</email>
// <date>9/27/2009</date>
// <summary>Skip list collection.</summary>

// License:

// Product: Engine.csproj
// Author: Robert N. Tenney
// Copyright: 9/27/2009

// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation version 2
// of the License.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

// This license covers all source code, binaries, and other materials related to this project
// unless specifically stated otherwise.

using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Drawing;

namespace TenneySoftware.Engine.Algorithms {
    /// <summary>
    /// Collection list of skipped locations.
    /// </summary>
    public class SkipListCollection : Collection<Point> {
        /// <summary>
        /// Initializes a new instance of the SkipListCollection class.
        /// </summary>
        public SkipListCollection() :
        base(new List<Point>()) {
        }

        /// <summary>
        /// Copys a SkipListCollection from the origin to the destination.
        /// </summary>
        /// <param name="origin">Origin of the list.</param>
        /// <param name="destination">Destination list.</param>
        public static void Copy(SkipListCollection origin, SkipListCollection destination) {
            foreach (Point location in origin) {
                destination.Add(location);
            }
        }

        /// <summary>
        /// Copys a SkipListCollection to this instance.
        /// </summary>
        /// <param name="origin">Origin of the list.</param>
        public void Copy(SkipListCollection origin) {
            SkipListCollection.Copy(origin, this);
        }
    }
}
